@{block content}
<h1>{$title}</h1>

<p>
    <a href="{plink add}" class="button ui-state-default ui-corner-all" title="{!_'Add permission'}">{!_"Add permission"}</a>
    {if ($search !== "" && $search !== null)}
        <a href="{plink default ''}" class="button ui-state-default ui-corner-all" title="{!_'Show all privileges'}">{!_"Show all privileges"}</a>
    {/if}
</p>


{include '../aclSearch.phtml'}

{snippet list}

{control paginator}

{if count($acl)}<table>
    <tr>
        <th>{!_"Role"}</th>
        <th>{!_"Resource"}</th>
        <th>{!_"Privilege"}</th>
        <th>{!_"Access"}</th>
        <th>{!_"Edit"}</th>
        <th>{!_"Delete"}</th>
    </tr>
    {foreach $acl as $ac}
        <tr>
            <td>{$ac->getRole()->getName()}</td>
            <td>{$ac->getResource()->getName()}</td>
            <td>{$ac->getPrivilege()->getName()}</td>
            <td class="center"><img src="{$basePath}/images/kernel/acl/{if $ac->getAllowed()}true{else}false{/if}.gif" title="{if $ac->getAllowed()}{!_'Access granted'}{else}{!_'Access denied'}{/if}"  width="20" height="20" alt="{if $ac->getAllowed()}{!_'Access granted'}{else}{!_'Access denied'}{/if}" /></td>
            <td><a href="{plink edit, $ac->id}" class="button ui-state-default ui-corner-all" title="{!_'Edit permission'}"><span class="ui-icon ui-icon-wrench">{!_"edit"}</span></a></td>
            <td><a href="{plink delete, $ac->id}" class="button ui-state-default ui-corner-all" title="{!_'Delete permission'}"><span class="ui-icon ui-icon-trash">{!_"delete"}</span></a></td>
        </tr>
    {/foreach}
    </table>
{/if}

{/snippet}